{template 'member', 'header'}
<div class="layui-member-center">
  {template 'member', 'left'}
  <div class="layui-member-info">
	<form name="myform" action="{APP_PATH}index.php?m=message&c=index&a=send" method="post" id="myform" class="layui-form">
	<div class="layui-form-item">
       <label class="layui-form-label">收信人：</label>
       <div class="layui-input-block">
       	<input name="info[send_to_id]" type="text" id="username" class="layui-input" style="width: 200px;"/>
       </div>
    </div>
    <div class="layui-form-item">
       <label class="layui-form-label">标 题：</label>
       <div class="layui-input-block">
       	<input name="info[subject]" type="text" id="subject" class="layui-input" style="width: 200px;"/>
       </div>
     </div>
     <div class="layui-form-item">
       <label class="layui-form-label">内 容：</label>
       <div class="layui-input-block">
       	<textarea name="info[content]" id="con" class="layui-textarea" style="width: 450px;"></textarea>
       </div>
     </div>
     <div class="layui-form-item">
       <label class="layui-form-label">验证码：</label>
       <div class="layui-input-inline">
       	<input name="code" type="text" id="code" class="layui-input" style="width: 200px;"/>
       </div>
       <div class="layui-input-inline"> {form::checkcode('code_img','4','14',120,60)}</div>
     </div>
     <div class="layui-form-item">
       <div class="layui-input-block">
       	<input type="submit" name="dosubmit" id="dosubmit" value="确 定" class="layui-btn"/>
       </div>
     </div>
   </form>
  </div>
</div>
<script>
<!--
layui.use('jquery', function(){
	var $ = layui.jquery;
	$(function(){
		$.formValidator.initConfig({autotip:true,formid:"myform",onerror:function(msg){}});
		$("#subject").formValidator({onshow:"请输入标题",onfocus:"标题不能为空"}).inputValidator({min:1,max:999,onerror:"标题不能为空"});
		$("#con").formValidator({onshow:"请输入内容",onfocus:"内容不能为空"}).inputValidator({min:1,max:999,onerror:"内容不能为空"});
		$("#username").formValidator({onshow:"请填写收信人",onfocus:"收信人不能为空"}).inputValidator({min:1,onerror:"请输入收件人ID"}).ajaxValidator({type : "get",url : "",data :"m=message&c=index&a=public_name",datatype : "html",async:'false',success : function(data){if( data == 1 ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "禁止给自己或非注册用户发送消息! ",onwait : "正在链接中...."});
	
		$("#code").formValidator({onshow:"请输入验证码",onfocus:"验证码不能为空"}).inputValidator({min:1,max:999,onerror:"验证码不能为空"}).ajaxValidator({
	    	type : "get",
			url : "",
			data :"m=pay&c=deposit&a=public_checkcode",
			datatype : "html",
			async:'false',
			success : function(data){	
            	if(data == 1){
                	return true;
				}
            	else{
                	return false;
				}
			},
			buttons: $("#dosubmit"),
			onerror : "验证码错误",
			onwait : "验证中"
		});
	});
});
//-->
</script>
{template 'member', 'footer'}